/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ManagedBeans;

import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.model.SelectItem;
import radio.entities.City;
import radio.sessions.CityFacade;

/**
 *
 * @author Kim
 */
public class ComboBox {
    @EJB
    private CityFacade cityFacade;

    /** Creates a new instance of ComboBox */
    public ComboBox() {
    }
    private ArrayList<SelectItem> arr;
    public ArrayList<SelectItem> getItems(){
        arr=new ArrayList<SelectItem>();
        List<City> lst=cityFacade.findAll();
        for(int i=0;i<lst.size();i++){
        arr.add(new SelectItem(lst.get(i).getCityId(), lst.get(i).getCityName()));
        }
        return arr;
    }
    
}
